package com.example.market.mapper;

import com.example.market.pojo.Product;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@org.apache.ibatis.annotations.Mapper
public interface ProductMapper extends Mapper<Product> {

    @Select("select product_id from product")
    List<Integer> selectIds();

    @Select("select * from product where product_name like #{search} limit #{begin}, #{end}")
    List<Product> search(String search, int begin, int end);

    @Select("select count(*) from product where product_name like #{search}")
    int searchCount(String search);

}